import request from '@/utils/request.js'

/**
 * @description 登录
 * @param data { code: string, appid: string }
 */
export const userLoginApi = (data) => {
	return request.get(`/openplatform/wxa/user/login`, { params: data })
}


/**
 * @description 获取用户信息
 * @param data { signature: string, rawData: string, encryptedData: string, iv: string }
 */
export const getUserInfoApi = (data, sessionId) => {
	return request.get(`/openplatform/wxa/user/info`, {
		params: data,
		header: {
			sessionId
		}
	})
}

/**
 * @description 批量增加
 * @param data { openId: 用户, name: 设备名称, items: [ statusFlag:状态, eventAt: 时间 ] }
 */
export const devPhotonAddApi = (data) => {
	return request.post(`/single/devPhoton/adds2`, data)
}

/**
 * @description 批量增加
 * @param data { openId: 用户, name: 设备名称, items: [ statusFlag:状态, eventAt: 时间 ] }
 */
export const devPhotonPageApi = (data) => {
	return request.post(`/single/devPhoton/page`, data)
}